<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('read_url')) {
  function read_url($url) {
    $ch = curl_init();

    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_HEADER, FALSE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

    // ZIS: run
    curl_setopt($ch, CURLOPT_PROXY, 'proxy.zis.co.yu:8080');
    curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'Laszlo.Pokoradi:fru5uN3m');

    // grab URL and pass it to the browser
    $data = curl_exec($ch);

    // close cURL resource, and free up system resources
    curl_close($ch);

    return $data;
  }
}
?>